import java.util.HashMap;
import java.util.Map;

public class Solution {
    public static void main(String[] args) {
        String s = threeSum("asdfdsasdfcdraaamk");
        System.out.println(s);
    }

    private static String threeSum(String s) {
        String str =null;
        Map<Character , Integer> map=new HashMap<>();
        for (int i = 0; i < s.length(); i++) {
            if (map.containsKey(s.charAt(i))){
                Integer value = map.get(s.charAt(i));
                map.put(s.charAt(i), ++value);
            }
            map.put(s.charAt(i),1);
        }
        int max=0;
        for (Character character : map.keySet()) {
            if(map.get(character)>max){
                max=map.get(character);
                str= String.valueOf(character);
            }
        }
        return str;
    }
}

